<?php
namespace app\web\validate;

use think\Validate;

/**
 * 行为验证器
 * @package app\menus\validate
 * @author
 */
class ViperCard extends Validate
{
    //定义验证规则
    protected $rule = [
        'avatar'  => 'require',
        'mobile'  => 'require|mobile',
        'is_receiver_message'  => 'require',
        'name'=>'require',
        'gender'  => 'require',
        'viper_type_id'  => 'require',
        'birthday'  => 'require',
        'saler'  => 'require',
        'amount'  => 'require',
        'new_card_no'  => 'require',
    ];
    //定义验证提示
    protected $message = [
        'avatar.require' => '请上传头像',
        'mobile.require' => '请输入手机号',
        'mobile.mobile' => '请输入正确的手机号',
        'is_receiver_message.require' => '请选择短信设置',
        'name.require' => '请填写姓名',
        'gender.require' => '请选择性别',
        'viper_type_id.require' => '请选择会员卡类型',
        'birthday.require' => '请填写生日',
        'saler.require' => '请选择销售人',
        'amount.require' => '请填写金额',
        'new_card_no.require' => '请填写新卡号',
    ];

    //定义验证场景
    protected $scene = [
        'supplement'   =>  ['amount','name','viper_type_id','is_receiver_message','gender','new_card_no'],
    ];

}
